﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="_619BJP.Models"%>
<%@ Import Namespace="_619BJP.Web.Controllers" %>
<asp:Content ID="Content3" ContentPlaceHolderID="TitleContent" runat="server">
   619保健品点评网
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">

    <link href="../../Content/css/Instance/Product/ProductIndex.css" rel="stylesheet"
        type="text/css" />
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

   <div id="navigation">
   <span>你现在的位置： <a href="/Home/Index">首页</a> ></span> 
   <span > <a href="/Product/ProductIndex">保健品</a></span>
   </div>

   <div id="ProductCategory">
    <div class="title"></div>
<%--    <span class="category_title">减肥瘦身</span>
     <div class="category_content">
     <a>减肥茶</a>
     <a>苹果醋酸</a>
    
     <a>代餐食品</a>
     <a>纤体抑脂</a>
     <a>修身咖啡</a>
     <a>左旋肉碱</a>
     <a>藤黄果</a>
      <a>燃脂素纤体</a>
     </div>


     <span class="category_title">减肥瘦身</span>
     <div class="category_content">
     <a>减肥茶</a>
     <a>苹果醋酸</a>
    
     <a>代餐食品</a>
     <a>纤体抑脂</a>
     <a>修身咖啡</a>
     <a>左旋肉碱</a>
     <a>藤黄果</a>
      <a>燃脂素纤体</a>
     </div>


     <span class="category_title">减肥瘦身</span>
     <div class="category_content">
     <a>减肥茶</a>
     <a>苹果醋酸</a>
    
     <a>代餐食品</a>
     <a>纤体抑脂</a>
     <a>修身咖啡</a>
     <a>左旋肉碱</a>
     <a>藤黄果</a>
      <a>燃脂素纤体</a>
     </div>


     <span class="category_title">减肥瘦身</span>
     <div class="category_content">
     <a>减肥茶</a>
     <a>苹果醋酸</a>
    
     <a>代餐食品</a>
     <a>纤体抑脂</a>
     <a>修身咖啡</a>
     <a>左旋肉碱</a>
     <a>藤黄果</a>
      <a>燃脂素纤体</a>
     </div>--%>
        <%System.Data.DataSet ds_cate = (new ProductController()).GetProductCategory();
          if (ds_cate.Tables[0].Rows.Count > 0)
          {%>
          <ul>
             <% for (int i = 0; i < ds_cate.Tables[0].Rows.Count; i++)
              {
        %>
            <li>
            <a href="/Product/ProductList/<%=ds_cate.Tables[0].Rows[i]["category_id"].ToString()%>"><%=ds_cate.Tables[0].Rows[i]["category_name"].ToString()%></a>
            </li>
        <%
          }%>
            </ul>
          <%} %>
     </div>

    <div id="piclist">
     <img  src="../../ProductImages/pic.jpg" alt="#"/>
    </div>
        <%System.Data.DataSet ds_cate_product = (new ProductController()).GetCategoryOrderbyProductCount(4);
          if (ds_cate_product.Tables[0].Rows.Count > 0)
          {
              for (int i = 0; i < ds_cate_product.Tables[0].Rows.Count; i++)
              {
            %>
        <div class="catgory_details">
            <div class="title"> 
                <%=ds_cate_product.Tables[0].Rows[i]["category_name"].ToString()%> 
                <a class="more" href="/Product/ProductList/<%=ds_cate_product.Tables[0].Rows[i]["category_id"].ToString()%> ">查看更多 >></a>  
            </div>
            <ul class="product_list">
                <%System.Data.DataSet ds_product = (new ProductController()).GetProductList(int.Parse(ds_cate_product.Tables[0].Rows[i]["category_id"].ToString()), 4);
                  if (ds_product.Tables[0].Rows.Count > 0)
                  {
                      for (int j = 0; j < ds_product.Tables[0].Rows.Count; j++)
                      {
                %>
                <li>
                    <a href="/Product/ProductDetails/<%=ds_product.Tables[0].Rows[j]["id"].ToString()%>">
                        <img src="../..<%=ds_product.Tables[0].Rows[j]["img_url"].ToString() %>"/>
                    </a>
                    <span>
                    <a href="/Product/ProductDetails/<%=ds_product.Tables[0].Rows[j]["id"].ToString()%>">
                        <%=ds_product.Tables[0].Rows[j]["product_name"].ToString()%>
                    </a>
                    </span>
                </li>
                <%} %>
            </ul>
        </div>
    <%}
              }
          } %>

    <div id="month_attention">
    <div id="attention_list" class="title">本月最受关注产品Top10</div>
    <%System.Data.DataSet ds_hot = (new ProductController()).GetHotProducts(10);
      if (ds_hot.Tables[0].Rows.Count > 0)
      {
    %>
    <ul>
        <%for (int i = 0; i < 3; i++)
          {
              string product_name = (new _619BJP.Web.Controllers.ArticleController()).TitleForShort(Html.Encode(ds_hot.Tables[0].Rows[i]["product_name"]), 10);
            %>
        <li>
            <div class="rank_num_top"><span><%=i + 1%></span></div>
            <div class="article_name">
                <a href="/Product/ProductDetails/<%= Html.Encode(ds_hot.Tables[0].Rows[i]["id"])%>" title="<%=ds_hot.Tables[0].Rows[i]["product_name"] %>">
                    <%= product_name%>
                </a>
            </div>
        </li>
        <%}
            for (int j = 3; j < 10; j++)
            {
                string product_name = (new _619BJP.Web.Controllers.ArticleController()).TitleForShort(Html.Encode(ds_hot.Tables[0].Rows[j]["product_name"]), 10);
            %>
        <li>
            <div class="rank_num"><span><%=j+1%></span></div>
            <div class="article_name">
                <a href="/Product/ProductDetails/<%= Html.Encode(ds_hot.Tables[0].Rows[j]["id"])%>" title="<%=ds_hot.Tables[0].Rows[j]["product_name"] %>">
                    <%= product_name%>
                </a>
            </div>
        </li>
        <%} %>    

    </ul>
    <%}
      else
      { %>暂无
    <%} %>

    </div>


</asp:Content>